package com.es.disped.dao.mapper;

import com.es.disped.dao.model.ContestStudentRel;
import com.es.disped.dao.model.ContestStudentRelExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

/**
 * @author Anson<br>
 *	Copyright by EasyShare 2019<br>
 *  
 *  All right reserved<br>
 *
 *  Created on 2019年7月27日 下午8:45:25<br>
 *  名称：ContestStudentRelMapper.java<br>
 *  描述：班级学生关系模型<br>
 */
//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface ContestStudentRelMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @SelectProvider(type=ContestStudentRelSqlProvider.class, method="countByExample")
    long countByExample(ContestStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @DeleteProvider(type=ContestStudentRelSqlProvider.class, method="deleteByExample")
    int deleteByExample(ContestStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @Delete({
        "delete from contest_student_rel",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @Insert({
        "insert into contest_student_rel (rel_id, contest_id, ",
        "student_id, student_phone, ",
        "complate_rate)",
        "values (#{relId,jdbcType=CHAR}, #{contestId,jdbcType=INTEGER}, ",
        "#{studentId,jdbcType=CHAR}, #{studentPhone,jdbcType=VARCHAR}, ",
        "#{complateRate,jdbcType=DOUBLE})"
    })
    int insert(ContestStudentRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @InsertProvider(type=ContestStudentRelSqlProvider.class, method="insertSelective")
    int insertSelective(ContestStudentRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @SelectProvider(type=ContestStudentRelSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="contest_id", property="contestId", jdbcType=JdbcType.INTEGER),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_phone", property="studentPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="complate_rate", property="complateRate", jdbcType=JdbcType.DOUBLE)
    })
    List<ContestStudentRel> selectByExample(ContestStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @Select({
        "select",
        "rel_id, contest_id, student_id, student_phone, complate_rate",
        "from contest_student_rel",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="contest_id", property="contestId", jdbcType=JdbcType.INTEGER),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_phone", property="studentPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="complate_rate", property="complateRate", jdbcType=JdbcType.DOUBLE)
    })
    ContestStudentRel selectByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @UpdateProvider(type=ContestStudentRelSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ContestStudentRel record, @Param("example") ContestStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @UpdateProvider(type=ContestStudentRelSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ContestStudentRel record, @Param("example") ContestStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @UpdateProvider(type=ContestStudentRelSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ContestStudentRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_student_rel
     *
     * @mbg.generated Thu Jul 18 11:57:58 CST 2019
     */
    @Update({
        "update contest_student_rel",
        "set contest_id = #{contestId,jdbcType=INTEGER},",
          "student_id = #{studentId,jdbcType=CHAR},",
          "student_phone = #{studentPhone,jdbcType=VARCHAR},",
          "complate_rate = #{complateRate,jdbcType=DOUBLE}",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(ContestStudentRel record);
}